package com.powernode.common;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 描述：统计项目的返回数据对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    //添加成功失败的返回常量
    @JsonIgnore
    public static Result ADD_SUCCESS=new Result(200,"添加成功");
    @JsonIgnore
    public static Result ADD_ERROR=new Result(-1,"添加失败");
    //修改成功失败的返回常量
    @JsonIgnore
    public static Result UPDATE_SUCCESS=new Result(200,"修改成功");
    @JsonIgnore
    public static Result UPDATE_ERROR=new Result(-1,"修改失败");
    //删除成功失败的返回常量
    @JsonIgnore
    public static Result DEL_SUCCESS=new Result(200,"删除成功");
    @JsonIgnore
    public static Result DEL_ERROR=new Result(-1,"删除失败");
    //操作成功失败的返回常量
    @JsonIgnore
    public static Result OPT_SUCCESS=new Result(200,"操作成功");
    @JsonIgnore
    public static Result OPT_ERROR=new Result(-1,"操作失败");


    private Integer code=0;//状态码
    private String msg="";//消息
    private Long count=0L;//数量  针对于layui的数据表格
    private Object data;//数据

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
